function getPath(){
    var strFullPath=window.document.location.href;
    var strPath=window.document.location.pathname;
    var pos=strFullPath.indexOf(strPath);
    var prePath=strFullPath.substring(0,pos);
    var postPath=strPath.substring(0,strPath.substr(1).indexOf('/')+1);
    var path ="<%=request.getContextPath() %>";
    return path;
    // return(prePath+postPath);
}
function getNowFormatDate() {
    var date = new Date();
    return getFormatDate(date);
}
function getTomorrowFormatDate() {
    var date = new Date();
    date.setDate(date.getDate()+1);
    return getFormatDate(date);
}
function getFormatDate_dining() {
    var date = new Date();
    console.log( getFormatDate(date));
    if(date.getHours()>17&&date.getMinutes()>30){
        date.setDate(date.getDate()+2);
    }
    else{
        date.setDate(date.getDate()+1);
    }
    return getFormatDate(date);
}
function getFormatDate(date) {
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    var strHours = date.getHours()
    var strMinutes = date.getMinutes();
    var strSeconds = date.getSeconds();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    if (strHours >= 0 && strHours <= 9) {
        strHours = "0" + strHours;
    }
    if (strMinutes >= 0 && strMinutes <= 9) {
        strMinutes = "0" + strMinutes;
    }
    if (strSeconds >= 0 && strSeconds <= 9) {
        strSeconds = "0" + strSeconds;
    }
    //2015-09-24T13:59:59
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
        // + "T" + strHours + seperator2 + strMinutes
        // + seperator2 + strSeconds;

    return currentdate;
}
//只允许输入数字正负号
function checkInput(obj)
{
    var value=obj.value;
    var reg= new RegExp(/([^0-9-+])/g);//  /(*)/g  [^0-9-]  -》  [^0-9]  排除0-9与-
    obj.value=value.replace(reg,'');
}
function onclick_obj_refresh(id,url) {
    $.ajax({
        type: "POST",
        url: url ,//url
        success: function (result) {
            id.html(result);
        },
        error : function() {
        }
    });
}
